package com.gree.elasticsearch.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 总有刁民想害朕，请叫我小花狗
 * create by zxw on 2020/5/27
 */
@RequestMapping("/api/")
@RestController
public class IndexController {
    private final String MESSAGE = "OK";

    @PreAuthorize(value = "hasRole('USER')")
    @GetMapping("/index")
    public String index() {
        return MESSAGE;
    }

}
